$(function(){
	$('#reset').click(function(){
		$('#user').val('');
		$('#pwd').val('');
	});

	$('#login_c').click(function(){
		var user = $('#user').val().trim();
		var pwd = $('#pwd').val().trim();
		if(!user || !pwd){
			alert('用户名或密码不得为空！');exit;
		}
		$.ajax({
			url:'./Control/login_c.php',
			data:{
				user:user,
				pwd:pwd
			},
			type:'post',
			success:function(res){
				if(res == 'ok'){
					sessionStorage.loginStat = true;
					alert('登陆成功！');
					location.href='index.html';
				}else{
					alert('用户名或密码不正确！');exit;
				}
			}
		});
	});
	
});